package com.untour.im.codec.constants;

import com.alibaba.fastjson2.TypeReference;
import com.untour.im.codec.protocol.message.body.*;
import com.untour.im.codec.protocol.message.content.GroupRequestMessageContent;
import com.untour.im.codec.protocol.message.content.ImageMessageContent;
import com.untour.im.codec.protocol.message.content.SingleRequestMessageContent;
import com.untour.im.codec.protocol.message.content.TxtMessageContent;

/**
 * im常量
 */
public class IMConstants {
    /**
     * 自定义协议头信息长度
     */
    public static final int CLIENT_PROTOCOL_HEADER_LENGTH = 28;
    public static final int SERVER_PROTOCOL_HEADER_LENGTH = 8;


    public static final String ReadTime = "readTime";
    public static final TypeReference<LoginMessageBody> LOGIN_MESSAGE_TYPE_REFERENCE = new TypeReference<LoginMessageBody>() {};
    public static final TypeReference<LoginRespMessageBody> LOGIN_RESPONSE_MESSAGE_TYPE_REFERENCE = new TypeReference<LoginRespMessageBody>() {};
    public static final TypeReference<OfflineMessageBody> OFFLINE_MESSAGE_TYPE_REFERENCE = new TypeReference<OfflineMessageBody>() {};
    public static final TypeReference<HeartBeatMessageBody> HEART_BEAT_MESSAGE_TYPE_REFERENCE = new TypeReference<HeartBeatMessageBody>() {};
    public static final TypeReference<ImMessageBody<TxtMessageContent>> TXT_MESSAGE_TYPE_REFERENCE = new TypeReference<ImMessageBody<TxtMessageContent>>() {};
    public static final TypeReference<ImMessageBody<ImageMessageContent>> IMAGE_MESSAGE_TYPE_REFERENCE = new TypeReference<ImMessageBody<ImageMessageContent>>() {};
    public static final TypeReference<ImMessageBody<SingleRequestMessageContent<TxtMessageContent>>> SINGLE_TXT_MESSAGE_TYPE_REFERENCE = new TypeReference<ImMessageBody<SingleRequestMessageContent<TxtMessageContent>>>() {};
    public static final TypeReference<ImMessageBody<SingleRequestMessageContent<ImageMessageContent>>> SINGLE_IMAGE_MESSAGE_TYPE_REFERENCE = new TypeReference<ImMessageBody<SingleRequestMessageContent<ImageMessageContent>>>() {};
    public static final TypeReference<ImMessageBody<GroupRequestMessageContent<TxtMessageContent>>> GROUP_TXT_MESSAGE_TYPE_REFERENCE = new TypeReference<ImMessageBody<GroupRequestMessageContent<TxtMessageContent>>>() {};
    public static final TypeReference<ImMessageBody<GroupRequestMessageContent<ImageMessageContent>>> GROUP_IMAGE_MESSAGE_TYPE_REFERENCE = new TypeReference<ImMessageBody<GroupRequestMessageContent<ImageMessageContent>>>() {};

}
